import VueRouter  from "vue-router";

const routes = [
  {
    path: '/login',
    name: 'login',
    component:()=>import('../components/Login.vue'),
  },
  {
    path: '/',
    redirect:'/Home',
    name: 'index',
    component:()=>import('../components/index.vue'),
    children:[
      {
        path:'Home',
        name:'home',
        component:()=>import('../components/aside/home/Home.vue'),
        meta:{
          title:'首页'
        }
      },
      {
        path:'Jingyin',
        name:'jingyin',
        component:()=>import('../components/aside/home/JingYin.vue'),
        meta:{
          title:'经营资料'
        }
      },
      {
        path:'Vendor',
        name:'vendor',
        component:()=>import('../components/aside/home/Vendor.vue'),
        meta:{
          title:'供应商信息'
        }
      },

      {
        path:'ZhiYuan',
        name:'zhiyuan',
        component:()=>import('../components/aside/information/ZhiYuanInformation.vue')
      },
      {
        path:'Sector',
        name:'sector',
        component:()=>import('../components/aside/information/SectorInformation.vue')
      },

      {
        path:'User',
        name:'user',
        meta:{
          title:'用户管理'
        },
        component:()=>import('../components/aside/User.vue')
      },
      {
        path:'UserCenter',
        name:'usercenter',
        meta:{
          title:'个人中心'
        },
        component:()=>import('../components/aside/UserCenter.vue')
      },


      {
        path:'Role',
        name:'role',
        meta:{
          title:'角色管理'
        },
        component:()=>import('../components/aside/Role.vue')
      },

      {
        path:'WareHouse',
        name:'warehouse',
        meta:{
          title:'仓库管理'
        },
        component:()=>import('../components/aside/WareHouse.vue')
      },
      {
        path:'RoleWareHouse',
        name:'rolewarehouse',
        meta:{
          title:'角色仓库关系管理'
        },
        component:()=>import('../components/aside/RoleWareHouse.vue')
      },

      {
        path:'ShangPin',
        name:'shangpin',
        meta:{
          title:'商品管理'
        },
        component:()=>import('../components/aside/ShangPin.vue')
      },

      {
        path:'SPApply',
        name: 'spapply',
        component:() =>import('../components/SPApply.vue')
      },

      {
        path:'OutWare',
        name:'outware',
        meta:{
          title:'出库操作'
        },
        component:()=>import('../components/aside/OutWare.vue')
      },
      {
        path:'InWare',
        name:'inware',
        meta:{
          title:'入库操作'
        },
        component:()=>import('../components/aside/InWare.vue')
      },
    ]

  },
  {
    path:'/Zhiyuan',
    name:'Zhiyuaninformation',
    meta:{
      title:'职员'
    },
    component:()=>import('../components/aside/information/ZhiYuanInformation.vue')
  },

 
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router